package com.njwd.rpc.provider.wsimpl;

import java.math.BigDecimal;
import java.util.LinkedList;
import java.util.List;




import org.springframework.stereotype.Component;

import com.njwd.common.rpc.ResponseVo;
import com.njwd.rpc.api.UserService;
import com.njwd.rpc.vo.User;

@Component("UserServiceImpl")
public class UserServiceImpl implements UserService{

	@Override
	public ResponseVo<Boolean> registerUser(User user) {
		System.out.println("provider:-registerUser:"+user);
		//handler
		return ResponseVo.getSuccessResponse(true);
	}

	@Override
	public ResponseVo<List<User>> queryUserByClassId(String id) {
		System.out.println("provider:queryUserByClassId:"+id);
		List<User> us = new LinkedList<User>();
		us.add(new User(new BigDecimal(10), "n1", "p1"));
		us.add(new User(new BigDecimal(10), "n2", "p2"));
		us.add(new User(new BigDecimal(10), "n3", "p3"));
		return ResponseVo.getSuccessResponse(us);
	}

	@Override
	public ResponseVo<List<User>> queryUserMultiParam(String id, long classId) {
		System.out.println("queryUserMultiParam:"+id+",classId"+classId);
		List<User> us = new LinkedList<User>();
		us.add(new User(new BigDecimal(10), "n1", "p1"));
		us.add(new User(new BigDecimal(10), "n2", "p2"));
		us.add(new User(new BigDecimal(10), "n3", "p3"));
		return ResponseVo.getSuccessResponse(us);
	}

}
